package com.lemurian.bankdata.servicebean;

import java.util.List;

import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.lemurian.bankdata.bean.ActivityLogDAO;
import com.lemurian.bankdata.dto.LogHelper;
import com.lemurian.bankdata.lite.struts.PartialList;
import com.lemurian.bankdata.services.ActivityLogService;
import com.lemurian.entity.ActivityLog;

@Service("activityLogService")
@Transactional(readOnly=true)
public class ActivityLogBean implements ActivityLogService {

	@Autowired private ActivityLogDAO dao;
	
	@Override
	@Transactional(readOnly=false,propagation=Propagation.REQUIRED)
	public void delete(ActivityLog entity) {
		dao.delete(entity);
	}

	@Override
	@Transactional(readOnly=false,propagation=Propagation.REQUIRED)
	public void delete(int id) {
		dao.delete(id);
	}

	@Override
	@Transactional(readOnly=false,propagation=Propagation.REQUIRED)
	public int delete(String sql) {
		return dao.delete(sql);
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public List<ActivityLog> findAll() {
		return dao.findAll();
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public List<ActivityLog> findAll(Order order) {
		return dao.findAll(order);
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public List<ActivityLog> findByCriteria(Order order, Criterion... criterion) {
		return dao.findByCriteria(order, criterion);
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public PartialList<ActivityLog> findByCriteria(int start, int count, Order order, Criterion... criterion) {
		return dao.findByCriteria(start, count, order, criterion);
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public ActivityLog findByCriteria(Criterion... criterion) {
		return dao.findByCriteria(criterion);
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public ActivityLog findById(int id) {
		return dao.findById(id);
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public ActivityLog load(int id) {
		return dao.load(id);
	}

	@Override
	@Transactional(readOnly=false,propagation=Propagation.REQUIRED)
	public ActivityLog save(ActivityLog entity) {
		return dao.save(entity);
	}

	@Override
	@Transactional(readOnly=false,propagation=Propagation.REQUIRED)
	public ActivityLog update(ActivityLog entity) {
		return dao.update(entity);
	}

	@Override
	@Transactional(readOnly=false,propagation=Propagation.REQUIRED)
	public void saveUserActivity(LogHelper actHelper) {
		dao.saveUserActivity(actHelper);
	}

}